import { lazy } from "react";
const homeRoutes = [
  {
    path: "/index/home",
    element: lazy(() =>
      import("../view/Index/IndexChildren/homeView/homeView")
    ),
    meta: {
      id: "index-home",
      title: "首页",
    },
  },
  {
    path: "/index/flat_hunting",
    element: lazy(() =>
      import("../view/Index/IndexChildren/FlatHunting/FlatHunting")
    ),
    meta: {
      id: "index-flat_hunting",
      title: "找房",
    },
  },
  {
    path: "/index/pubish",
    element: lazy(() => import("../view/Index/IndexChildren/Publish/Publish")),
    meta: {
      id: "index-pubish",
      title: "发布",
    },
  },
  {
    path: "/index/message",
    element: lazy(() => import("../view/Index/IndexChildren/Message/Message")),
    meta: {
      id: "index-message",
      title: "消息",
    },
  },
  {
    path: "/index/my",
    element: lazy(() => import("../view/Index/IndexChildren/My/My")),
    meta: {
      id: "index-my",
      title: "我的",
    },
  },
];
// 一级路由
const routes = [
  {
    path: "/",
    to: "/index/home",
  },
  {
    path: "/index",
    element: lazy(() => import("../view/Index/Index")),
    meta: {
      id: "index",
      title: "index",
    },
    children: homeRoutes,
  },
  {
    path: "/index/home/old_house",
    element: lazy(() => import("../view/HouseViewList/OldHouse/OldHouse")),
    meta: {
      id: "old_house",
      title: "二手房",
    },
  },
  {
    path: "/index/home/new_house",
    element: lazy(() => import("../view/HouseViewList/NewHouse/NewHouse")),
    meta: {
      id: "new_house",
      title: "新房",
    },
  },
  {
    path: "/index/home/rent_out_house",
    element: lazy(() =>
      import("../view/HouseViewList/RantOutHouse/RantOutHouse")
    ),
    meta: {
      id: "rent_out_house",
      title: "出租房",
    },
  },
  {
    path: "/index/detail",
    element: lazy(() => import("../view/DetailView/DetailView")),
    meta: {
      id: "detail",
      title: "详情页",
    },
  },
  {
    path: "/index/vr",
    element: lazy(() => import("../view/VRView/Index")),
    meta: {
      id: "index-vr",
      title: "vr",
    },
  },
  {
    path: "/index/customer_server",
    element: lazy(() => import("../view/CustomerServer/Index")),
    meta: {
      id: "customer_server",
      title: "客服",
    },
  },
  {
    path: "/index/home/map_find_house",
    element: lazy(() =>
      import("../view/HouseViewList/MapFindHouse/MapFindHouse")
    ),
    meta: {
      id: "map_find_house",
      title: "地图找房",
    },
  },
  {
    path: "/index/mortgage_calculator",
    element: lazy(() =>
      import("../view/MortgageCalculator/Index")
    ),
    meta: {
      id: "mortgage_calculator",
      title: "房贷计算",
    },
  },
  {
    path: "/index/home/route_planning",
    element: lazy(() =>
      import("../view/RoutePlanning/Index")
    ),
    meta: {
      id: "route_planning",
      title: "路线规划",
    },
  },
]


export { routes, homeRoutes };
